<template>
  <div class="top" @click="toTop">
    <image class="img" src="https://cdn-cos-ke.myoed.com/ke_proj/mobilev2/m-core/03de0936a7aafee76646b8b2d5fa5b4f.png" mode="=widthFix"/>
  </div>
</template>

<script setup lang="ts">
import {} from '@dcloudio/uni-app'

//定义方法
//点击回到顶部
const toTop = ()=>{
  uni.pageScrollTo({
    scrollTop : 0
  })
}
</script>

<style scoped lang="less">
  .top {
  .img {
    width: 100rpx;
    height: 100rpx;
    position: fixed;
    bottom: 80rpx;
    right: 20rpx;
  }
}
</style>